package com.woniuxy.loanapprovals.service.serviceimpl;

import com.woniuxy.entity.LoanApproval;
import com.woniuxy.loanapprovals.mapper.LoanApprovalMapper;
import com.woniuxy.loanapprovals.service.LoanApprovalService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class LoanApprovalServiceImpl implements LoanApprovalService {

    @Resource
    LoanApprovalMapper loanApprovalMapper;

   /*
   实现审核添加
    */
    @Override
    public void addApproval(LoanApproval loanApproval) {

        loanApprovalMapper.addApproval(loanApproval);
    }

    /*
    查询所有
     */
    @Override
    public List<LoanApproval> selectAllLoanApproval() {

        return loanApprovalMapper.selectAllLoanApproval();
    }

    /*
    根据id查询
     */
    @Override
    public LoanApproval selectLoanApprovalById(int id_loan) {
        return loanApprovalMapper.selectLoanApprovalById(id_loan);
    }

    /*
    根据id删除
     */
    @Override
    public void deleteLoanApprovalById(int id_loan) {

        loanApprovalMapper.deleteLoanApprovalById(id_loan);
    }

    /*
    修改状态--审核通过
     */
    @Override
    public void updateLoanApprovalById(LoanApproval loanApproval) {

        loanApprovalMapper.updateLoanApprovalById(loanApproval);
    }
}
